<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Spatie\Activitylog\Models\Activity;

class IndexController extends Controller
{
    public function index(Request $request){
//        dd(auth()->user()->follower->pluck('id'));
        $db=Activity::orderBy('created_at','desc');
        if($request->query('t')){
            $db->whereIn('causer_id',auth()->user()->follower->pluck('id'));
        }
        $actives=$db->paginate(10);

        return view('home.index.index',compact('actives'));
    }
}
